ALL EDITORS V443 — SHARED ACCOUNT REGISTRY + PER-EXECUTABLE LUA
==============================================================

Keeps the uploaded V442 FROZEN_READ_ONLY reference unchanged. V443 is a
separate build. The original BaldurII.exe and Baldur.lua are not patched.

Requested layout (profile = Documents/BaldursGate2Online):
  BaldurII.exe                  -> Baldur.lua (default, original)
  BaldurII_Drakhysys.exe       -> Drakhysys.lua
  BaldurII_Kronas.exe          -> Kronas.lua
  <profile>/_DRAKHYSYS_ACCOUNT_SYSTEM/account_registry_v443.json

A unique, byte-for-byte-verified BaldurII.exe reference was inspected:
  'Baldur.lua' stored in a 16-byte null-padded filename field.
  The account filename may contain at most 11 ASCII characters plus '.lua'.
  'home:/characters' has room for 17, but the shorter limit controls.
  V443 refuses account executable names longer than 11; it NEVER truncates.
  New UI account names must have 2–11 ASCII letters, initial uppercase.

Existing V442 behavior: character-directory patch, original BG2 native UI,
multiplayer and campaign code remain otherwise unchanged. The V438 executable
patch now changes three fields on its COPY: characters path, startup account
marker, and Lua settings filename. Game version string is untouched.

SHARED REGISTRY
  - The registry stores exact account name and the complete existing V118
    SHA-256 password verifier (NOT the plaintext password).
  - Registration uses an interprocess exclusive lock, fsync and atomic replace.
    Two simultaneous creates of the same account cannot overwrite one another.
  - Each BG2 window writes ONLY its own account Lua preferences; on prelaunch,
    the registry verifier is re-inserted into that account Lua.
  - On login, the router compares the Lua verifier with the shared registry.
    A tampered or stale Lua verifier is rejected.
  - Setup discovers existing registrations from account marker directories and
    old Baldur.lua account keys and migrates complete verifiers; it never resets
    an existing shared registry password. Incomplete/conflicting records are
    skipped, not silently re-created.
  - Existing account files and character files are not deleted.

HOW TO INSTALL
  1. Make a separate offline backup of your documents profile and game files.
  2. CLOSE ALL BG2 WINDOWS before installing.
  3. Extract ALL EDITORS V443 and run SETUP_IN_GAME_ACCOUNTS.bat.
  4. Verify that Drakhysys.lua, Kronas.lua etc. appeared alongside Baldur.lua
     in Documents/BaldursGate2Online. Verify corresponding BaldurII_<name>.exe
     files appear in the BG2 install folder.
  5. Test a single account login, native import/export and logout first.
  6. Test each account independently before attempting two game windows.

SAFETY AND LIMITATIONS
  - This was tested offline on copies and with the uploaded reference binary.
    It has NOT been validated with BG2 running on Windows.
  - Modifying an executable copy invalidates its embedded code signature.
  - The prior UI/router publishes a shared override response for all windows;
    it was not refactored into a fully concurrent per-window reply system.
    Simultaneous gameplay, folder handoffs and reply races require live tests.
  - Old accounts whose names exceed the embedded 11-character filename limit
    are preserved, not truncated or migrated into a modified EXE. Use the
    original default executable for those or change the architecture separately.
  - The verifier algorithm is retained for compatibility; it is not an upgrade
    to a new memory-hard password hashing scheme.
  - No original executable is distributed in this archive: the installer makes
    account-specific COPIES from the user's existing BaldurII.exe.

Offline tests:
  python -m unittest test_v443_account_registry_executable test_v438_account_exe test_v440_account_picker test_v442_host_campaign -v
